﻿package frEngine.animateControler.particleControler.animate
{
    import __AS3__.vec.*;
    import frEngine.animateControler.particleControler.*;

    public class UseParticleSize extends Object implements IParticleAnimate
    {
        private var _smoothData:Vector.<uint>;
        public static const instance:UseParticleSize = new UseParticleSize;

        public function UseParticleSize()
        {
            return;
        }// end function

        public function get objClass() : Class
        {
            return UseParticleSize;
        }// end function

        public function canOpen(param1:ParticleParams) : Boolean
        {
            return param1.useParticleSize;
        }// end function

        public function init(param1:ParticleStatus, param2:ParticleParams) : void
        {
            this._smoothData = param2.sizeSmoothData;
            return;
        }// end function

        public function update(param1:ParticleStatus) : void
        {
            var _loc_4:ParticleItem = null;
            var _loc_6:int = 0;
            var _loc_7:int = 0;
            var _loc_8:Number = NaN;
            if (!this._smoothData)
            {
                return;
            }
            var _loc_2:* = param1.particleList;
            var _loc_3:* = _loc_2.length;
            var _loc_5:int = 0;
            while (_loc_5 < _loc_3)
            {
                
                _loc_4 = _loc_2[_loc_5];
                if (_loc_4.visible && _loc_4.toUpdate)
                {
                    _loc_6 = _loc_4.lifeRate * 128;
                    _loc_7 = this._smoothData[_loc_6];
                    _loc_8 = _loc_7 / 255;
                    _loc_4.size = _loc_8;
                }
                _loc_5++;
            }
            return;
        }// end function

    }
}
